<h2>Dungeon generators</h2>

<p>This family of map generators produces corridors and rooms. Room information can be retrieved after the map has been created by calling <code>getRooms()</code>; corridor information can be retrieved via <code>getCorridors()</code>. Rooms can also include door info:</p>

<div class="example">
ROT.RNG.setSeed(1234);
var map = new ROT.Map.Digger();
var display = new ROT.Display({fontSize:8});
SHOW(display.getContainer());
map.create(display.DEBUG);

var drawDoor = function(x, y) {
	display.draw(x, y, "", "", "red");
}

var rooms = map.getRooms();
for (var i=0; i&lt;rooms.length; i++) {
	var room = rooms[i];
	SHOW(ROT.Util.format("Room #%s: [%s, %s] => [%s, %s]",
		(i+1),
		room.getLeft(), room.getTop(),
		room.getRight(), room.getBottom()
	));

	room.getDoors(drawDoor);
}
</div>

<h3>Digger</h3>

<p>Random dungeon generator using human-like digging patterns; based on Mike Anderson's ideas from the "Tyrant" algo, mentioned at 
<a href="http://roguebasin.com/index.php/Dungeon-Building_Algorithm">Roguebasin</a>. 
Third constructor argument is a configuration object; allowed options:</p>
<ul>
	<li><code>roomWidth</code> &ndash; [min, max] room size</li>
	<li><code>roomHeight</code> &ndash; [min, max] room size</li>
	<li><code>corridorLength</code> &ndash; [min, max] corridor length</li>
	<li><code>dugPercentage</code> &ndash; algorithm stops after this fraction of map area has been dug out; default = 0.2</li>
	<li><code>timeLimit</code> &ndash; algorithm stops after this amount of milliseconds has passed</li>
</ul>

<div class="example">
var w = 40, h = 25;
var map = new ROT.Map.Digger(w, h);

for (var i=0; i&lt;4; i++) {
	var display = new ROT.Display({width:w, height:h, fontSize:6});
	SHOW(display.getContainer());
	map.create(display.DEBUG);
}
</div>

<h3>Uniform</h3>

<p>Generates a set of rooms; tries to connect them afterwards. Third constructor argument is a configuration object; allowed options:</p>
<ul>
	<li><code>roomWidth</code> &ndash; [min, max] room size</li>
	<li><code>roomHeight</code> &ndash; [min, max] room size</li>
	<li><code>roomDugPercentage</code> &ndash; algorithm stops after this fraction of map area has been filled with rooms; default = 0.1</li>
	<li><code>timeLimit</code> &ndash; algorithm stops after this amount of milliseconds has passed</li>
</ul>


<div class="example">
var w = 40, h = 25;
var map = new ROT.Map.Uniform(w, h);

for (var i=0; i&lt;4; i++) {
	var display = new ROT.Display({width:w, height:h, fontSize:6});
	SHOW(display.getContainer());
	map.create(display.DEBUG);
}
</div>

<h3>Rogue</h3>

<p>The original Rogue dungeon algorithm, as documented at <a href="https://github.com/Davidslv/rogue-like/blob/master/docs/references/Mark_Damon_Hughes/07_Roguelike_Dungeon_Generation.md">https://github.com/Davidslv/rogue-like/blob/master/docs/references/Mark_Damon_Hughes/07_Roguelike_Dungeon_Generation.md</a></p>

<div class="example">
var w = 80, h = 24;
var map = new ROT.Map.Rogue(w,h);
var display = new ROT.Display({width:w, height:h, fontSize:6});
SHOW(display.getContainer());
map.create(display.DEBUG);  
</div>
